﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 电梯调度程序第一阶段算法CS
{
    class DestList:List<int>
    {
        int currentposition, currentdirection;
        public DestList(int position,int direction)
        {
            currentposition = position;
            currentdirection = direction;
        }
        public int Currentposition
        {
            get { return currentposition; }
            set { currentposition = value; }
        }
        public int Currentdirection
        {
            get { return currentdirection; }
            set { currentdirection = value; }
        }
        public int next()
        {
            currentposition += currentdirection;
            if (currentposition < 0 || currentposition > Elevator.flooramount)
            {
                currentdirection *= -1;
                currentposition += currentdirection;
            }
            return currentposition;
        }
    }
}
